package com.dhu719.label_end.mapper;

import com.dhu719.label_end.domain.Label;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>Title: $file.className</p>
 * <p>Description: </p>
 *
 * @author Kaboon
 * @date
 */
@Mapper
public interface LabelMapper {
    @Insert("insert into label " +
            "values " +
            "(#{label.image_id},#{label.username},#{label.label_info},#{label.diagnose},#{label.status})")
    int AddLabel(@Param("label")Label label);

    @Select("select * from label " +
            "where " +
            "image_id = #{image_id} " +
            "and username = #{username}")
    Label selectByImageId(@Param("image_id")String image_id,
                          @Param("username")String username);

    @Update("update label " +
            "set " +
            "label_info = #{label.label_info}," +
            "diagnose = #{label.diagnose}," +
            "status = #{label.status}")
    int update(@Param("label") Label label);
}
